import 'package:car_map/mode/time_scale.dart';
import 'package:car_map/page/res/gaps.dart';
import 'package:car_map/widget/widget_oil_expansionpanellist.dart';
import 'package:car_map/widget/widget_time_scale.dart';
import 'package:flutter/material.dart';
///加油统计
class AddoilCountPage extends StatefulWidget{
  @override
  _addoilCountState createState()=>_addoilCountState();

}

class _addoilCountState extends State<AddoilCountPage>{

  List<TimeScale> timeList;

  @override
  void initState() {
    // TODO: implement initState
    super.initState();
    getTimeScaleList();
  }

  @override
  Widget build(BuildContext context) {
    // TODO: implement build
    return Scaffold(
      appBar: AppBar(
        title: Text(
          '加油统计'
        ),
      ),body: Container(
      child: ListView(
        children: <Widget>[
          TimeScaleWidget(
            timeScaleList: timeList,
          ),
          Gaps.vGap10,
          OilExpansionPanelListWidget(),
        ],
      ),
    ),
    );
  }

  getTimeScaleList() {
    timeList = new List();
    timeList.add(new TimeScale(title: '今天', index: 0));
    timeList.add(new TimeScale(title: '三天', index: 1));
    timeList.add(new TimeScale(title: '近一周', index: 2));
    timeList.add(new TimeScale(title: '近一月', index: 3));
    timeList.add(new TimeScale(title: '本周', index: 4));
    timeList.add(new TimeScale(title: '本月', index: 5));
  }

}